package com.jk.controller;

import com.jk.pojo.ProBean;
import com.jk.pojo.ServiceEntity;
import com.jk.service.ProService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @author jisiqi
 * @version 1.0
 * @description: TODO    服务项目管理Controller
 * @date 2022/10/16 19:32
 */
@RestController
@RequestMapping("serProject")
public class ServiceController {

    @Autowired
    private ProService proService;

    /**
     * @description:  查询服务项目管理MySQL并新增es
     * @param:
     * @return: java.util.Map
     * @author 纪思齐
     * @date: 2022/10/16 19:39
     */
    @RequestMapping("getProList")
    public Map getProList(){
        return  proService.getProList();
    }

    /**
     * @description: 查询es+高亮
     * @param: proBean
     * @return: java.util.Map
     * @author 纪思齐
     * @date: 2022/10/16 20:49
     */
    @RequestMapping("queryServiceEsList")
    public Map queryServiceEsList(ProBean proBean){
        return proService.queryServiceEsList(proBean);
    }

    /**
     * @description: 根据服务项目管理id删除MySQL和es
     * @param: id
     * @return: boolean
     * @author 纪思齐
     * @date: 2022/10/17 9:04
     */
    @RequestMapping("deleteProId")
    public  boolean deleteProId(@RequestParam Integer id){
        return proService.deleteProId(id);
    }

    /**
    * @Author: binzi
    * @Description:查询服务包
    * @Date: 2022/10/18 15:08
    * @Return: java.util.List<com.jk.pojo.ServiceEntity>
    **/
    @RequestMapping("findService")
    public List<ServiceEntity> findService(){
        return proService.findService();
    }

}
